/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2013 All Rights Reserved.
 */
package com.pingan.mobilegw.core.model.constant;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * UpstreamHandler 顺序order常量值
 * 
 * @author jiadao
 * @version $Id: UpstreamHandlerOrderConstant.java, v 0.1 2013-8-12 下午2:23:43 jiadao Exp $
 */
public class UpstreamHandlerOrderConstant {

    private static int           interval      = 10;
    private static AtomicInteger atomicInteger = new AtomicInteger(0);

    /** 刷新token */
    public static final int      REFRESH_TOKEN = getAndIncrement();
    /** 写流 */
    public static final int      RESPONSE_DATA = getAndIncrement();
    /** 提交无线session */
    public static final int      CACHE_SESSION = getAndIncrement();
    /** 记录pv */
    public static final int      PV_LOG        = getAndIncrement();

    /**
     * 获取并增长
     * 
     * @return
     */
    private static int getAndIncrement() {
        return atomicInteger.getAndAdd(interval);
    }
}
